package com.yunhe.common.model.data;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 储能单元电池整体效率对象
 */
public class BatteryWholeEfficiency {
    /**
     * 储能单元代码
     */
    private Long energyUnitCode;

    /**
     * 日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date dtime;

    /**
     * 效率值
     */
    private Double val;

    public BatteryWholeEfficiency() {
    }

    public BatteryWholeEfficiency(Long energyUnitCode, Date dtime, Double val) {
        this.energyUnitCode = energyUnitCode;
        this.dtime = dtime;
        this.val = val> 100.0 ? 100.0 : val;
    }

    public Long getEnergyUnitCode() {
        return energyUnitCode;
    }

    public void setEnergyUnitCode(Long energyUnitCode) {
        this.energyUnitCode = energyUnitCode;
    }

    public Date getDtime() {
        return dtime;
    }

    public void setDtime(Date dtime) {
        this.dtime = dtime;
    }

    public Double getVal() {
        return val;
    }

    public void setVal(Double val) {
        this.val = val> 100.0 ? 100.0 : val;
    }

    @Override
    public String toString() {
        return "BatteryWholeEfficiency{" +
                "energyUnitCode=" + energyUnitCode +
                ", dtime=" + dtime +
                ", val=" + val +
                '}';
    }
}
